package com.team.engine.fileupload.action;

import com.team.engine.common.view.BaseActionAbs;

public class LoginAction extends BaseActionAbs{

	private static final long serialVersionUID = 2676055971849629669L;
	
	private String username;
	
	@Override
	public String execute() throws Exception {
		
		this.session.put("userid", "aaa");
		System.out.println("~~~~~~sessionId: "+session.keySet());
//		System.out.println("~~~~request: "+request.getParameter("username"));
		System.out.println("~~~~username: "+this.getUsername());
		
		String validateCodeIn = this.request.getParameter("validate_code_in");
		if( ! validateCodeIn.equalsIgnoreCase(this.session.get("rand").toString())){
			this.request.setAttribute("errorMsg", "验证码错误");
			return "g_login";
		}
		
		return SUCCESS;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

}
